@extends('layouts.app')

@section('title', '卡券商家列表')

@section('css-import')

<!-- <link rel="stylesheet" type="text/css" href="{{config('app.inlet_src')}}/assets/css/htmleaf-demo.css"> -->
<link rel="stylesheet" href="{{config('app.inlet_src')}}assets/css/baguetteBox.min.css">
<!-- <link rel="stylesheet" href="{{config('app.inlet_src')}}/assets/css/gallery-grid.css"> -->
<style type="text/css">
	.identitycardimg_sty{
		width:300px;
		display:block;
	}
	.qrcodeimg{
		cursor:pointer;
	}
	.page-s{
		display: inline-block;
		padding-bottom: 0px;
		margin: 29px 9px;
		border-radius: 4px;
		float:  right;
	}
</style>
@endsection

@section('content-fluid')
<div class="row">
	<!-- BASIC TABLE -->
	<div class="panel">
		<div class="panel-heading">
			<h3 class="panel-title">卡券商家</h3>
		</div>
		<div class="panel-body">
			<table class="table table-hover">
				<thead>
					<tr>
						<th>#</th>
						<th>店铺名</th>
						<th>手机号</th>
						<th>入驻时间</th>
						<th>账户余额</th>
						<th>地址</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					@foreach($shops as $k=>$v)
					<tr>
						<td>{{$v->id}}</td>
						<td class="shopname">{{$v->shop_name}}</td>
						<td>{{$v->tel}}</td>
						<td>{{$v->created_at}}</td>
						<td>{{$v->amount}}</td>
						<td>{{$v->address}}</td>
						<td><a href="/coupon/shop/detail?shop_id={{$v->id}}"><i class="fa fa-info-circle"></i> 查看</a></td>
					</tr>
					@endforeach
				</tbody>
			</table>
			{{ $shops->links() }}
			<div class="page-s">本页共{{ $shops->count() }}条</div>
			<div class="page-s">共{{ $shops->total() }}条</div>
			<div class="page-s">当前第{{ $shops->currentPage() }}页</div>
			<div class="page-s">共{{ $shops->lastPage() }}页</div>
		</div>
		
	</div>
	<!-- END BASIC TABLE -->
</div>
<div class="modal fade" tabindex="-1" id="exampleModal" role="dialog">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title"></h4>
      </div>
      <div class="modal-body">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
      </div>
    </div>
  </div>
</div>
<img src="" class="identitycardimg identitycardimg_sty center-block hide">
@endsection

@section('js-import')
<script type="text/javascript" src="{{config('app.inlet_src')}}assets/scripts/baguetteBox.min.js"></script>
@endsection

@section('js-write')
<script type="text/javascript">
	baguetteBox.run('.tz-gallery');
	function urlClick(url,this_l) {
		var this_ = $('<img src="" width="30" title="点击放大" class="qrcodeimg">');
		var modal = $('#exampleModal');
		modal.find('.modal-body').empty();
		modal.find('.modal-title').html($(this_l).parents('tr').find('.shopname').html()+'的二维码');
	    $(this_).attr('src',""+'/'+url).attr('class','identitycardimg identitycardimg_sty center-block');
	    modal.find('.modal-body').append($(this_));
		$('#exampleModal').modal();
	}
</script>
@endsection